public class test7 {
    //力扣   495. 提莫攻击
    public int findPoisonedDuration(int[] timeSeries, int d) {
        int ret = 0;
        for(int i = 1;i<timeSeries.length;i++){
            int x = timeSeries[i] - timeSeries[i-1];
            if(x>=d){
                ret+=d;
            }else{
                ret+=x;
            }
        }

        return ret+d;
    }
}
